import {
	uploadImage
} from '@/utils/upload';

export default {

	props: {
		dataObj: {
			type: Object,
			default: () => {
				return {}
			}
		},
		sumbitShow: {
			type: Boolean,
			default: true
		},
	},
	mounted() {

		if (!this.sumbitShow) { //判断是录入还是查看，查看就赋值
			for (let i in this.dataForm) {
				this.$set(this.dataForm, i, this.dataObj[i])
			}
		}

	},
	data() {
		return {

		}
	},
	onReady() {
		this.$refs.uForm.setRules(this.rules);
	},
	methods: {
		onUpload(name) {
			uploadImage().then(res => {
				this.$set(this.dataForm, name, res[0][0])
			})
		},
		goSelect() {
			this.$refs.addressSelectRef.goSelect()
		},
	}
}
